Skip to content

Avoid duplicate sitemap roots on subpath deployments - #126

Closed
sansynx wants to merge 1 commit into
cloudflare:mainfrom
sansynx:fix/subpath-sitemap-root
Closed

Avoid duplicate sitemap roots on subpath deployments#126
sansynx wants to merge 1 commit into
cloudflare:mainfrom
sansynx:fix/subpath-sitemap-root

Conversation

@sansynx

@sansynx sansynx commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Closes #121

The sitemap integration joins an empty home-page path to base verbatim, but adds a trailing slash for the root route in directory builds. With base set to /my-project, those become two different sitemap entries.

This normalizes base only in the config passed to the sitemap integration. The app's base stays unchanged, and file output and trailingSlash: never retain their existing behavior.

Validation:

  • Reproduced the duplicate in generated sitemap XML before the fix
  • 10 sitemap and hidden-version tests passed
  • Framework build and typecheck passed
  • Starter build passed, with the existing Pagefind spawn warning
  • ESLint reported no source errors; the test file is outside its configured scope
  • templates:check could not spawn pnpm on Windows (ENOENT)
  • Stopped the broader test run after failures in CLI path separators, type coverage, and image-reference tests outside this change

Keeping this in draft for CI validation. Prepared with an AI coding assistant

@MohamedH1998

MohamedH1998 commented Sep 9, 2026

Copy link
Copy Markdown
Collaborator

hey @sansynx, appreciate this, but this is already resolved by this PR - so I'll close this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sub-path deployments: the sitemap lists the site root twice (with and without a trailing slash)

2 participants